﻿using System;
using Volo.Abp.Domain.Entities.Auditing;
using YaAppoint.Rules;

namespace YaAppoint
{
    /// <summary>
    /// 规则
    /// </summary>
    public class Rule : FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 所属层级
        /// </summary>
        public virtual RuleLevel Level { get; set; }

        /// <summary>
        /// 逻辑类型
        /// </summary>
        public virtual LogicType LogicType { get; set; } = LogicType.Required;

        /// <summary>
        /// 名称
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// 服务类名 (加命名空间的完整类型名称)
        /// </summary>
        public virtual string TypeName { get; set; }

        /// <summary>
        /// 脚本内容
        /// C#代码
        /// </summary>
        public virtual string? Script { get; set; }

        /// <summary>
        /// Json
        /// 条件表达式，基于“Vue Query Builder”组件生成的条件组合json
        /// </summary>
        public virtual string? Expression { get; set; }

        /// <summary>
        /// 规则组ID
        /// </summary>
        public virtual Guid? RuleGroupId { get; set; }



        // 描述
        public virtual string? Description { get; set; }


        /// <summary>
        /// 排序
        /// </summary>
        public virtual int Order { get; set; } = 0;

        /// <summary>
        /// 活动
        /// </summary>
        public virtual bool IsActive { get; set; } = true;

        /// <summary>
        /// 科室ID
        /// </summary>
        public virtual Guid? DepartmentId { get; set; }

        /// <summary>
        /// 科室
        /// </summary>
        public virtual Department? Department { get; set; }

        /// <summary>
        /// 设备类型ID
        /// </summary>
        public virtual Guid? DeviceTypeId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public virtual DeviceType? DeviceType{get;set;}

        /// <summary>
        /// 设备ID
        /// </summary>
        public virtual Guid? DeviceId { get; set; }

        /// <summary>
        /// 设备
        /// </summary>
        public virtual Device? Device { get; set; }
    }
}
